﻿using System;
using log4net.Repository.Hierarchy;

namespace WJ.Infrastructure.Log
{
    public class Log
    {
        private static readonly log4net.ILog Logger;

        static Log()
        {
            Logger = log4net.LogManager.GetLogger("Logger");

        }
        public static void Error(object message, Action<object> action = null)
        {
            try
            {
                Logger.Error(message);

                action?.Invoke(message);
            }
            catch
            {

            }

        }

        public static void Info(object message)
        {
            try
            {
                Logger.Info(message);
            }
            catch
            {

            }

        }
    }
}